package com.ssm.user.designPattern.abstractFactoryPattern.easy;

import com.ssm.user.designPattern.abstractFactoryPattern.easy.Color.Color;
import com.ssm.user.designPattern.abstractFactoryPattern.easy.Shape.Shape;

public class AbstractFactoryPatternDemo {
    public static void main(String[] args) {
        //先获取工厂，再获取类
        AbstractFactory colorFactory = FactoryProducer.getFactory("COLOR");
        Color red = colorFactory.getColor("RED");
        red.fill();

        AbstractFactory shapeFactory = FactoryProducer.getFactory("SHAPE");
        Shape circle = shapeFactory.getShape("CIRCLE");
        circle.draw();
    }
}
